package arch.dao.impl.archive;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import arch.domain.archive.ReviewNote;
import arch.domain.user.User;

public class ReviewNoteMapper implements RowMapper {

	public Object mapRow(ResultSet rs, int i) throws SQLException {
		ReviewNote rn = new ReviewNote();
		User user = new User();
		rn.setId(rs.getString("id"));
		rn.setArchiveId(rs.getString("archive_id"));
		user.setUserId(rs.getString("author_id"));
		user.setUserName(rs.getString("author_name"));
		rn.setAuthor(user);
		rn.setMember(rs.getString("member"));
		rn.setNote(rs.getString("note"));
		rn.setConclusion(rs.getString("conclusion"));
		rn.setReviewingTime(rs.getDate("reviewing_time"));
		
		return rn;
	}

}
